package cn.edu.zafu.bigdata.x.sxy;

import java.util.Scanner;

public class TestInvalidScoreException {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in); // 创建Scanner对象
        try {
            System.out.print("请输入分数：");
            double score = scanner.nextDouble(); // 读取用户输入的分数
            ScoreValidator.checkScore(score); // 调用checkScore方法并传入分数
        } catch (InvalidScoreException e) {
            // 捕获InvalidScoreException并输出错误信息
            System.out.println("发生错误: " + e.getMessage());
        } finally {
            scanner.close(); // 关闭scanner
        }
    }
}